package com.zzld.modules.maintenance.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zzld.core.utils.CookieUtils;
import com.zzld.modules.common.dto.CommonJSON;

@Controller
@RequestMapping("/weixin/f/matenance/by/service")
public class WXMtanServiceController {
	
	@RequestMapping(value="/setids",method=RequestMethod.POST)
	@ResponseBody
	public CommonJSON setids(HttpServletRequest request,HttpServletResponse response){
		CommonJSON json = new CommonJSON();
		
	    String ids = request.getParameter("ids");
	    if(StringUtils.isNotBlank(ids)){
	    	CookieUtils.setCookie(response, "proids", ids.substring(0,ids.length()-1));
	        json.setSuccess(true);
	    }else{
	    	json.setSuccess(false);
	    }
		
		return json;
	}

}
